﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CourseSelectionSystem.Service;

namespace CourseSelectionSystem
{
    public partial class StudentSelect : Form
    {
        private CourseSelectionSystemServices service;
        public StudentSelect()
        {
            InitializeComponent();
            service = new CourseSelectionSystemServices();

            //获取当前时间
            label1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            //启用计时器
            timer1.Start();
        }

        private void StudentSelect_Load(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }

        private void StudentSelect_FormClosed(object sender, FormClosedEventArgs e)
        {
            //结束整个程序
            Application.Exit();
        }

        private void 可选课程ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var lst = service.GetAllc();
            this.dataGridView1.DataSource = lst;
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
